
from pom.Tengxun_adversiter import TXAdversiter, web


class Login:
    account = '// *[ @ placeholder = "请输入账号"]'
    password = '// *[ @ placeholder = "请输入密码"]'
    login_button = '//*[text()=" 登录 "]'
    url = 'http://101.126.43.226:8081/?#/login'

    def login(self):
        web.openbrowser()
        web.geturl(self.url)
        web.input(self.account, "admin")
        web.input(self.password, "Shanhaiad123")
        web.sleep("1")
        web.click(self.login_button)
        web.sleep("2")
        return TXAdversiter()

# class TXAdversiter:
#
#     account='//*[text()=" 批量新建 "]'
#     create_button='//*[text()=" 批量新建 "]'
#     window_name='腾讯程序化创建 | 山海经'
#     url='http://101.126.43.226:8081/?#/promotion/tencent/ad'
#
#     def into_txadversiter_create_interface(self):
#         web.sleep("1")
#         web.geturl(self.url)
#         web.sleep("1")
#         web.click(self.create_button)
#         web.switchwin(self.window_name)
#         web.sleep("1")


if __name__ == '__main__':
    Login().login().into_txadversiter_create_interface()

